package com.foreknow.mapping;

import com.foreknow.model.Food;

import java.sql.ResultSet;
import java.sql.SQLException;

public class FoodMapping implements EntityMapping{

    @Override
    public Object mapping(ResultSet rs) throws SQLException {
        Food food = new Food();
        food.setFoodId(rs.getInt("fid"));
        food.setFoodName(rs.getString("fname"));
        food.setFoodExplain(rs.getString("fexplain"));
        food.setFoodPrice(rs.getBigDecimal("fprice"));
        food.setBusinessId(rs.getInt("bid"));
        return food;
    }
}
